﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DNASequencing.core.data;

namespace DNASequencing.core.Algorithms.rating
{
    class SimpleRating : IRating
    {
        double IRating.rate(Oligonucleotide o)
        {
            o.rating = 0;

            int l = o.originalSequence.Length;
            for (int i = 0; i < o.next.Length; ++i)
                if (!o.used)
                    o.rating += (o.originalSequence.Length - 1 - i) * o.next[i].Count;

            o.rating += (l - o.error) * Math.Sqrt(l);
            
            return o.rating;
        }
    }
}
